<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <title>登录页面 - 后台管理中心</title>
    <meta name="renderer" content="webkit">
    <link rel="icon" href="/favicon.ico" type="image/ico">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__LAYUI__/css/layui.css" media="all">
    <link rel="stylesheet" href="__ADMIN__/style/admin.css" media="all">
    <link rel="stylesheet" href="__ADMIN__/style/login.css" media="all">
    <style>*{font-weight: 300;}</style>
</head>
<body>

<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">

    <div class="layadmin-user-login-main">
        <div class="layadmin-user-login-box layadmin-user-login-header">
            <h2>微群裂变 海报版</h2>
            <p>联系方式：{:fission('tel')}</p>
        </div>
        <div class="layadmin-user-login-box layadmin-user-login-body layui-form">

            <form class="layui-form" action="">
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="username"></label>
                    <input type="text" name="username" id="username" value="" lay-verify="required" placeholder="用户名" class="layui-input">
                </div>

                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="password"></label>
                    <input type="password" name="password" id="password" value="" lay-verify="required" placeholder="密码" class="layui-input">
                </div>

                <div class="layui-form-item">
                    <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="login">立即登录</button>
                </div>

            </form>
        </div>
    </div>

    <div class="layui-trans layadmin-user-login-footer">

        <p>&copy; <a target="_blank" href="http://weixinliebian.cn">怀念工作室</a> 版权所有</p>

    </div>

</div>

<script src="__LAYUI__/layui.js"></script>
<script src="__STATIC__/js/public.js"></script>
<script>
    layui.use(['jquery', 'form'], function(){
        var $ = layui.jquery, form = layui.form;

        //监听提交
        form.on('submit(login)', function(data){

            if (data.field.username.length < 3){
                error('用户名不能小于3位');
                return false;
            }

            if (data.field.password.length < 6){
                error('密码不能小于6位');
                return false;
            }

            $.post("{:url()}", data.field, function (res) {

                if ( res.code === 1 ){
                    success(res.msg, function () {
                        jump_url('/welcome.html')
                    });
                } else {
                    error(res.msg);
                }

            }, 'json');
            return false;
        });
    });

</script>

</body>
</html>